<template>
  <div>
      <h1 v-html="resourcebean.title"></h1>
      <p v-html="resourcebean.content"></p>
      <span>by: {{resourcebean.username}} -- {{resourcebean.date}}</span>
  </div>
</template>
<script>
import { getresource } from "@/api/resource";

export default {
  data() {
    return {
      id: 0,
      resourcebean: {},
    };
  },
  created() {
    this.updatedata()
  },
  methods: {
    updatedata() {
      this.id = this.$route.params.id
      getresource({id: this.id}).then(resp => {
        this.resourcebean = resp.data
      })
    }
  },
};
</script>
<style scoped>
</style>